In [1]:
import h5py 
import numpy as np 
In [2]:
h5_file = h5py.File('./latent_3d.h5', 'r') 
In [3]:
h5_file.keys()
Out[3]:
[u'RMSD', u'RMSD_cm', u'embed']
In [4]:
cm_predict = h5_file[u'embed'] 
RMSD_cm = h5_file[u'RMSD_cm'] 
RMSD = h5_file[u'RMSD'] 
In [5]:
import plotly
import plotly.graph_objs as go 

plotly.offline.init_notebook_mode(connected=True)

trace1 = go.Scatter3d(
    x=cm_predict[:,0][::10], 
    y=cm_predict[:,1][::10],
    z=cm_predict[:,2][::10],
    mode='markers',
    marker=dict(
        size=5,
        color=RMSD[::10],                # set color to an array/list of desired values
        colorbar=dict(title=''),
        colorscale='Jet',   # choose a colorscale
        opacity=1
    )
)

data = [trace1]
layout = go.Layout(
    margin=dict(
        l=0,
        r=0,
        b=0,
        t=0
    )
)
fig = go.Figure(data=data, layout=layout)
# plotly.offline.plot(fig, filename='cm_predict_1.html')
plotly.offline.iplot(fig)
In [6]:
import plotly
import plotly.graph_objs as go 

plotly.offline.init_notebook_mode(connected=True)

trace1 = go.Scatter3d(
    x=cm_predict[:,0][:100000:], 
    y=cm_predict[:,1][:100000:],
    z=cm_predict[:,2][:100000:],
    mode='markers',
    marker=dict(
        size=5,
        color=RMSD[:100000:],                # set color to an array/list of desired values
        colorbar=dict(title=''),
        colorscale='Jet',   # choose a colorscale
        opacity=1
    )
)

data = [trace1]
layout = go.Layout(
    margin=dict(
        l=0,
        r=0,
        b=0,
        t=0
    )
)
fig = go.Figure(data=data, layout=layout)
plotly.offline.plot(fig, filename='cm_predict_first_100k.html')
plotly.offline.iplot(fig)
In [7]:
import plotly
import plotly.graph_objs as go 

plotly.offline.init_notebook_mode(connected=True)

trace1 = go.Scatter3d(
    x=cm_predict[:,0][-100000:], 
    y=cm_predict[:,1][-100000:],
    z=cm_predict[:,2][-100000:],
    mode='markers',
    marker=dict(
        size=5,
        color=RMSD[-100000:],                # set color to an array/list of desired values
        colorbar=dict(title=''),
        colorscale='Jet',   # choose a colorscale
        opacity=1
    )
)

data = [trace1]
layout = go.Layout(
    margin=dict(
        l=0,
        r=0,
        b=0,
        t=0
    )
)
fig = go.Figure(data=data, layout=layout)
plotly.offline.plot(fig, filename='cm_predict_last_100k.html')
plotly.offline.iplot(fig)